<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\SupplierModel;
use Illuminate\Support\Facades\DB;

class SellerAdminController extends Controller
{
    //
    public function sellerAdminId(Request $request)
    {
        $sellerId = $request->get('q');
        $seller = SupplierModel::where('id', $sellerId)->get(['id', DB::raw('supplier_name as text')])->toArray();
        $sellerAr = SupplierModel::whereNotIn('id', [$sellerId])->get(['id', DB::raw('supplier_name as text')])->toArray();
        // dd($seller, $sellerAr);
        $arr[] = $seller;
        $arr[] = $sellerAr;
        return $arr;
    }
}
